package zhan.shiro.filter;

import org.apache.log4j.Logger;
import org.apache.shiro.web.filter.authc.AnonymousFilter;
import org.springframework.stereotype.Component;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

/**
 * 匿名过滤器---一般做参数的校验
 */
@Component("myFilter2")
public class MyFilter2 extends AnonymousFilter {
    public static final Logger log = Logger.getLogger(MyFilter2.class);
    @Override
    protected boolean onPreHandle(ServletRequest request, ServletResponse response, Object mappedValue) {
        log.info("匿名过滤器=======myFilter2");

        // 其实 super.onPreHandle(request, response, mappedValue) = true
        return super.onPreHandle(request, response, mappedValue);
    }
}
